home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 21
/
Cream of the Crop 21 (Terry Blount) (October 1996).iso
/
utility
/
base64_5.zip
/
BASE64.TXT
next >
Wrap
Text File
|
1996-08-21
|
19KB
|
447 lines
Documentation for the Base-64 Encoder:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Contents:
~~~~~~~~~
1. General information regarding the programs
2. About ENCODE64.EXE
3. About DECODE64.EXE
4. About UNIX2DOS.COM
5. Technical information regarding BASE-64 encoding
6. Disclaimer, Distribution, About the Author, etc.
7. Registration Information (Read this!)
8. Revision Notes
For information on SHELL64.EXE, refer to SHELL64.TXT.
Please register!
1. General:
~~~~~~~~~~~
These DOS programs have built-in error checking to make sure the files
are processed correctly. However, if there are unexplained errors while
processing, the program will give a "Runtime Error" message. Check in
this documentation for information regarding possible errors. Most errors
will likely be caused by the DECODE64 program, because of text-processing
problems. If all else fails, refer to the section on DECODE64 and see
how the program works! If you think a certain problem may be a bug in
the program, please e-mail me. My e-mail address is at the bottom of
this document.
NOTE: DECODE64 will ONLY decode files with a CR/LF at the end of every
line, so it will not decode UNIX text files. A utility I wrote was included
with these programs, called UNIX2DOS. See the section on UNIX2DOS.COM for
information on how to use it.
REGARDING E-MAIL: Internet mail programs will probably not recognize
encoded files over e-mail when encoded using ENCODE64. This is because
information is added to the header and body of sent e-mails when files
are included with them. It is impossible to mimic this with these
programs. Whoever receives a Base64 encoded file encoded using ENCODE64
may need a utility similar to DECODE64 to be able to decode it. (This
is especially true when using multiple-part encoding & decoding.)
2. About ENCODE64.EXE:
~~~~~~~~~~~~~~~~~~~~~~
This program takes any file (binary or otherwise) and converts it
into a format transmittable over the Internet. (See technical information
below.) The command line for this program is:
ENCODE64 <input filename> [output filename] [/M<number>] [/O] [/P]
Items in <> are necessary, in [] are optional.
Where <filename> is any file. [Output filename] is optional, but if you
do give it, ENCODE64 will attempt to use that file name instead of the
generic ".64" filename.
The "/O" option was added for compatibility purposes. When you use this
option, the program will AUTOMATICALLY attempt to overwrite any files
it needs to, without having a (Y/N) prompt. Use this carefully.
The "/M" option tells ENCODE64 to do a multiple-file output. A number
should immediately follow, telling ENCODE64 how many kilobytes (KB) of
data should be put into each file. 1 kilobyte is slightly less than
20 lines of data. The program will tell you if the number of kilobytes you
specified is too out of range for the particular file you are encoding.
The maximum number of files ENCODE64 will output to is 99 (for filename
reasons).
The "/P" option will turn on a percentage meter which tells how far
through ENCODE64 is. For single files, it will show how far it is
so far. For multiple files, it will show how far through it is for
the particular file it is working on. (The last file it creates may
not reach 100%)
Examples:
C:\>ENCODE64 PROGRAM.ZIP
After executing this, ENCODE64 will create a file called "PROGRAM.64" in
the current directory. If a file with that name was already found, it will
say so and will not overwrite it (it must be moved or deleted before
ENCODE64 will create the file, just to make sure that no data is lost).
C:\>ENCODE64 PROGRAM.ZIP PROG.TXT
ENCODE64 will attempt to make a file called PROG.TXT instead of the
generic PROGRAM.64. It will ask you if you wish to overwrite it if
it already exists.
C:\>ENCODE64 PROGRAM.ZIP PROG.TXT /M20 /O /P
ENCODE64 will attempt to make multiple files until the end of PROGRAM.ZIP
is reached. It will start with PROG01.TXT, put 20 kilobytes of encoded data
in it (approx. 400 lines of data), then move on to PROG02.TXT. If it
encountered PROG01.TXT already, it will automatically overwrite it because
the "/O" option was put on the command line. It will also have a percentage
meter which will show how far it is through each one of the files it
creates.
3. About DECODE64.EXE:
~~~~~~~~~~~~~~~~~~~~~~
Command line for this program is:
DECODE64 <input file/file mask> [output file] [/M] [/O] [/K] [/L]
Items in <> are necessary, in [] are optional.
Where <input filename> is any Base64-encoded file.
The "/O" option tells DECODE64 to automatically erase any files it needs
to without prompting you. Be careful when using this switch that you
do not overwrite any important files.
With the "/K" option, DECODE64 will continue reading through a Base64-
encoded file until all files are decoded out of it. This is useful
for messages where more than one file is sent. After finishing the
first file, it will look for the 'name="' or 'name = ' strings over
and over again until it doesn't find any more.
If you supply an [output filename], DECODE64 will use that instead
of the filename it finds inside the Base64-encoded file(s). When
using the "/M" option, DECODE64 will use the filename it finds in the
first Base64-encoded file it scans.
The "/M" option tells the program to accept input from more than one
file. If you use this, you should use a <filename mask> instead of a
single <input filename>. The mask should use generic DOS wildcard
characters such as '*' and '?'. Use the "DIR" command to make sure
the files are in the correct order before decoding. (See examples below.)
The "/L" option tells DECODE64 to decode multiple encoded files, one
at a time, using a <file mask>. This does not work with "/M". The
[output file] option does not work with this. "/K" is automatically
activated by the program when this switch is used, meaning that only
the first file located in each encoded file will be decoded, and
decoding will stop in each file as soon as the first file is finished.
(See examples below)
At the top of every multiple-part file created by ENCODE64, it tells what
part number the current file is, and how many parts there are totally.
This first number can be used to create the correct filename for decoding
multiple-part files, if you receive them in different e-mails. (Otherwise
there may not be a way to tell which file comes first, second, etc.) Note
that DECODE64 is *not* able to read this header automatically, since it
does not know which files are made with which encoder.
DECODE64 will automatically right- and left-justify all lines of encoded
data.
Examples:
C:\>DECODE64 PROGRAM.64 PROG.ZIP
Running it with this command line will make DECODE64 attempt to
decode PROGRAM.64, and, instead of using the file name it finds in
PROGRAM.64, it will use the filename PROG.ZIP to output to.
C:\>DECODE64 PROGRAM.64 PROG.ZIP /O
If PROG.ZIP already exists, DECODE64 will erase it without prompting.
C:\>DECODE64 PROG*.64 PROG.ZIP /M /O
DECODE64 will use the filename mask "PROG*.64" and use those files to
output to PROG.ZIP. DECODE64 will discard whatever filename it finds
in the PROG*.64 files, and use the name "PROG.ZIP" instead. If PROG.ZIP
already exists, DECODE64 will erase it without prompting. Be careful
when using the /M option -- use "DIR" before running DECODE64 to make
sure your files are in the correct order. Such as:
PROG01.64
PROG02.64
PROG03.64
...
This would be ideal. This is the order that ENCODE64 puts files in.
C:\>DECODE64 *.64 /L
This would decode all files with the ".64" extension, one at a time.
The ideal format for the BASE 64 file would be one created by the
ENCODE64 program, or in this format:
--==========================
name="test.zip"
<header stuff>
<header stuff>
AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIIIJJJJKKKKLLLLMMMMNNNNOOOOPPPP
QQ==
--==========================
Note the blank line between the header and the encoded data, and the
"-" char